#include "entityobject.h"

using namespace Opl::Core;
QString EntityObject::ID = "Object";

QScriptValue EntityObject::toScriptValue(QScriptEngine *engine, EntityObject* const &in)
{
    return engine->newQObject(in);
}

void EntityObject::fromScriptValue(const QScriptValue &object, EntityObject* &out)
{
    out = qobject_cast<EntityObject*>(object.toQObject());
}

QScriptValue EntityObject::construct_Script(QScriptContext *context, QScriptEngine *engine)
{
	return engine->newQObject(new EntityObject(0));
}

EntityObject::EntityObject(EntityObject *parent) :
	QObject(parent), Entity()
{
}

EntityObject::~EntityObject()
{

}

QString EntityObject::toString()
{
    return QString("[%1(id:%2 stamp:%3 tag:%4)]").arg(metaObject()->className()).arg(unique()).arg(stamp().toMSecsSinceEpoch()).arg(tag().typeName());
}
